package net.awpspace.mobile.management.point;

import java.util.Vector;

public class Data {
	
	private Vector data;

	private static Data instance;

	private Data() {
		data = new Vector();
		createConstance();
	}

	public static Data getInstance() {
		if (instance == null)
			instance = new Data();
		return instance;
	}

	public void insert(Diem d) {
		data.addElement(d);
	}

	public void remove(int i) {
		if(i < 0 || i >= data.size())
			return;
		data.removeElementAt(i);
	}
	public void remove(Diem d){
		data.removeElement(d);
	}
	public Vector getData(){
		return data;
	}
	
	public void createConstance(){
		insert(new Diem("Nguyễn Thị Kim", "D09CN3", "1234", new Time(5, 11, 1991), 7, 8, 9));
		insert(new Diem("Nguyễn Tiến Mạnh", "D09CN3", "2345", new Time(5, 11, 1991), 7, 6, 5));
		insert(new Diem("Nguyễn Tuấn Hải", "D09CN3", "6789", new Time(5, 11, 1991), 6, 7, 8));
		insert(new Diem("Nguyễn Hoàng Điệp", "D09CN3", "1456", new Time(5, 11, 1991), 7, 6, 8));
		insert(new Diem("Phạm Hồng Kỳ", "D09CN3", "2315", new Time(5, 11, 1991), 6, 7, 7));
	}
}
